package com.weight.system.quick.service.impl;

import com.weight.system.quick.PO.QuickInfo;
import com.weight.system.quick.service.QuickInfoService;
import com.weight.system.quick.DAO.QuickInfoMapper;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import org.springframework.transaction.annotation.Transactional;
import com.weight.common.util.CommonUtils;
import lombok.extern.slf4j.Slf4j;

/**
 * 快捷管理表
 */
@Service
@Transactional
@Slf4j
public class QuickInfoServiceImpl implements QuickInfoService {

	@Autowired
	private QuickInfoMapper quickInfoMapper;


	/**
	 * 查询快捷管理信息--条件查询
	 * @param map
	 * @return
	 */
	@Override
	public List<QuickInfo> findQuickInfoByT(Map map){
		return quickInfoMapper.findQuickInfoByT(map);
	}

	/**
	 * 查询快捷管理信息--条件，分页查询
	 * @param currentPage
	 * @param pageSize
	 * @param map
	 * @return
	 */
	@Override
	public List<QuickInfo> findQuickInfoByPage(int currentPage,int pageSize,Map map){
		PageHelper.startPage(currentPage, pageSize);
		List<QuickInfo> quickInfoList = quickInfoMapper.findQuickInfoByT(map);
		return quickInfoList;
	}

	/**
	 * 查询快捷管理信息--查询全部
	 * @return
	 */
	@Override
	public List<QuickInfo> findAll(){
		return quickInfoMapper.findAll();
	}

	/**
	 * ID查询快捷管理信息
	 * @param map
	 * @return
	 */
	@Override
	public QuickInfo findByQuickInfoId(Map map){
		QuickInfo quickInfo=quickInfoMapper.findByQuickInfoId(map);
		CommonUtils.validateExistObj(quickInfo,map);
		return quickInfo;
	}

	/**
	 * ID查询快捷管理信息-批量
	 * @param quickInfoIdList
	 * @return
	 */
	@Override
	public List findByQuickInfoIdList(List quickInfoIdList){
		List idList = quickInfoMapper.findByQuickInfoIdList(quickInfoIdList);
		CommonUtils.validateExistList(idList,quickInfoIdList);
		return idList;
	}

	/**
	 * 添加快捷管理
	 * @param quickInfo
	 */
	@Override
	public void insertQuickInfo(QuickInfo quickInfo){
		quickInfoMapper.insertQuickInfo(quickInfo);
	}

	/**
	 * 批量添加快捷管理
	 * @param quickInfoList
	 */
	@Override
	public void insertQuickInfoBatch(List<QuickInfo> quickInfoList){
		quickInfoMapper.insertQuickInfoBatch(quickInfoList);
	}

	/**
	 * 修改快捷管理
	 * @param quickInfo
	 */
	@Override
	public void updateQuickInfo(QuickInfo quickInfo){
		quickInfoMapper.updateQuickInfo(quickInfo);
	}

	/**
	 * 修改快捷管理
	 * @param quickInfo
	 */
	@Override
	public void updateQuickInfoLimt(QuickInfo quickInfo){
		quickInfoMapper.updateQuickInfoLimt(quickInfo);
	}

	/**
	 * 物理删除快捷管理
	 * @param map
	 */
	@Override
	public void deleteByQuickInfoId(Map map){
		quickInfoMapper.deleteByQuickInfoId(map);
	}

	/**
	 * 批量物理删除快捷管理
	 * @param quickInfoIdList
	 */
	@Override
	public void deleteByQuickInfoIdBatch(List quickInfoIdList){
		quickInfoMapper.deleteByQuickInfoIdBatch(quickInfoIdList);
	}

	/**
	 * 状态删除快捷管理
	 * @param map
	 */
	@Override
	public void upDelByQuickInfoId(Map map){
		quickInfoMapper.upDelByQuickInfoId(map);
	}

	/**
	 * 批量状态删除快捷管理
	 * @param quickInfoList
	 */
	@Override
	public void upDelByQuickInfoIdBatch(Map<String, Object> map){
		quickInfoMapper.upDelByQuickInfoIdBatch(map);
	}

}